package biz.obake.team.touchprotector.ui;

import android.os.Bundle;
import android.view.View;
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
import biz.obake.team.touchprotector.R;
import biz.obake.team.touchprotector.notice.ClosableNotice;
import biz.obake.team.touchprotector.notice.Notice;
import biz.obake.team.touchprotector.notice.a;

public class Tab_Notices extends a {
    /* access modifiers changed from: private */
    public void reshowClosedNotices() {
        for (Notice next : a.b().d()) {
            if (next instanceof ClosableNotice) {
                ((ClosableNotice) next).reopen();
            }
        }
        reloadSelf();
    }

    public void onCreatePreferences(Bundle bundle, String str) {
        setPreferencesFromResource(R.xml.ui_tab_notices, str);
        PreferenceScreen preferenceScreen = getPreferenceScreen();
        for (int L0 = preferenceScreen.L0() - 1; L0 >= 0; L0--) {
            Preference K0 = preferenceScreen.K0(L0);
            Notice c2 = a.b().c(K0.o());
            if (c2 != null && !c2.isVisible()) {
                preferenceScreen.O0(K0);
            }
        }
        preferenceScreen.H0("reshow_closed_notices").s0(new Preference.e() {
            public boolean onPreferenceClick(Preference preference) {
                Tab_Notices.this.reshowClosedNotices();
                return true;
            }
        });
    }

    /* access modifiers changed from: protected */
    public void onRamPrefChanged(String str) {
        if (Notice.Updated.equals(str)) {
            reloadSelf();
        }
    }

    public void onViewCreated(View view, Bundle bundle) {
        super.onViewCreated(view, bundle);
        View findViewById = view.findViewById(16908351);
        if (findViewById != null) {
            findViewById.setPadding(0, (int) getResources().getDimension(R.dimen.notice_divider_height), 0, 0);
        }
    }
}
